package com.bocai.freeman.view.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bocai.freeman.R;
import com.bocai.freeman.base.BaseActivity;
import com.bocai.freeman.utils.ToolbarHelper;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by admin on 2016/5/20.
 */
public class SettingActivity extends BaseActivity {

    @Bind(R.id.rl_my_data)
    RelativeLayout mRlMyData;
    @Bind(R.id.rl_my_dynamic)
    RelativeLayout mRlMyDynamic;
    @Bind(R.id.rl_blacklist)
    RelativeLayout mRlBlacklist;
    @Bind(R.id.rl_feedback)
    RelativeLayout mRlFeedback;
    @Bind(R.id.rl_about_us)
    RelativeLayout mRlAboutUs;
    @Bind(R.id.rl_common_problem)
    RelativeLayout mRlCommonProblem;
    @Bind(R.id.rl_share_app)
    RelativeLayout mRlShareApp;
    @Bind(R.id.tv_logout)
    TextView mTvLogout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);
        initEvent();
    }

    @Override
    protected void initEvent() {
        super.initEvent();
        ToolbarHelper.setup(this, R.string.setting, R.mipmap.left_return);
        click(mRlMyData).subscribe(o -> startActivityForResult(new Intent(SettingActivity.this,PersonDataActivity.class),1));
        click(mRlMyDynamic).subscribe(o -> {});
        click(mRlBlacklist).subscribe(o -> startActivity(new Intent(SettingActivity.this,BlackListActivity.class)));
        click(mRlFeedback).subscribe(o -> startActivity(new Intent(SettingActivity.this,FeedbackActivity.class)));
        click(mRlAboutUs).subscribe(o -> {});
        click(mRlCommonProblem).subscribe(o -> {});
        click(mRlShareApp).subscribe(o -> {});
        click(mTvLogout).subscribe(o -> {});
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        // TODO: 2016/5/20 去对个人信息改变后做的一些处理 
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
    }
}
